home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / nhx / mainform.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-08  |  5.1 KB  |  196 lines

  1. VERSION 2.00
  2. Begin Form MainForm 
  3.    Caption         =   "NHX"
  4.    ClientHeight    =   5085
  5.    ClientLeft      =   975
  6.    ClientTop       =   1965
  7.    ClientWidth     =   7365
  8.    Height          =   5775
  9.    Icon            =   MAINFORM.FRX:0000
  10.    Left            =   915
  11.    LinkMode        =   1  'Source
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   5085
  14.    ScaleWidth      =   7365
  15.    Top             =   1335
  16.    Width           =   7485
  17.    Begin CommandButton Command2 
  18.       Caption         =   "quit"
  19.       Height          =   375
  20.       Left            =   6240
  21.       TabIndex        =   1
  22.       Top             =   4080
  23.       Width           =   855
  24.    End
  25.    Begin Timer Timer1 
  26.       Interval        =   500
  27.       Left            =   960
  28.       Top             =   3960
  29.    End
  30.    Begin TextBox TextTopic 
  31.       Height          =   3615
  32.       Index           =   0
  33.       Left            =   120
  34.       MultiLine       =   -1  'True
  35.       ScrollBars      =   2  'Vertical
  36.       TabIndex        =   0
  37.       TabStop         =   0   'False
  38.       Text            =   "Text1"
  39.       Top             =   120
  40.       Width           =   6975
  41.    End
  42.    Begin Label StatusBar 
  43.       BackColor       =   &H00C0C0C0&
  44.       Caption         =   "statusbar"
  45.       FontBold        =   0   'False
  46.       FontItalic      =   0   'False
  47.       FontName        =   "MS Sans Serif"
  48.       FontSize        =   9.75
  49.       FontStrikethru  =   0   'False
  50.       FontUnderline   =   0   'False
  51.       Height          =   375
  52.       Left            =   0
  53.       TabIndex        =   2
  54.       Top             =   4680
  55.       Width           =   7335
  56.    End
  57.    Begin Menu mF 
  58.       Caption         =   "&File"
  59.       Begin Menu mFN 
  60.          Caption         =   "&New"
  61.       End
  62.       Begin Menu mFO 
  63.          Caption         =   "&Open..."
  64.       End
  65.       Begin Menu mFS 
  66.          Caption         =   "&Save"
  67.       End
  68.       Begin Menu mFX 
  69.          Caption         =   "e&Xit"
  70.       End
  71.       Begin Menu mFA 
  72.          Caption         =   "save &As"
  73.       End
  74.    End
  75.    Begin Menu mE 
  76.       Caption         =   "&Edit"
  77.       Begin Menu mEC 
  78.          Caption         =   "&Copy"
  79.       End
  80.       Begin Menu mEL 
  81.          Caption         =   "copy &Link"
  82.       End
  83.       Begin Menu mEP 
  84.          Caption         =   "&Paste"
  85.       End
  86.       Begin Menu mEPL 
  87.          Caption         =   "paste l&Iink"
  88.       End
  89.    End
  90.    Begin Menu mB 
  91.       Caption         =   "&Browse"
  92.       Begin Menu mBG 
  93.          Caption         =   "&Goto"
  94.       End
  95.       Begin Menu mBB 
  96.          Caption         =   "&Back"
  97.       End
  98.    End
  99.    Begin Menu mH 
  100.       Caption         =   "&Help"
  101.       Begin Menu mHA 
  102.          Caption         =   "&About..."
  103.       End
  104.       Begin Menu mHI 
  105.          Caption         =   "&Index"
  106.       End
  107.       Begin Menu mHS 
  108.          Caption         =   "&Search..."
  109.       End
  110.    End
  111. Sub Command2_Click ()
  112. DoQuit
  113. End Sub
  114. Sub Command2_KeyDown (KeyCode As Integer, Shift As Integer)
  115.     MainFormKeyPressHandler KeyCode, Shift
  116. End Sub
  117. Sub DoQuit ()
  118.     a% = MsgBox("save the hypertext?", 4 Or 32, APPNAME$)
  119.     If a% Then DoSave
  120.     End
  121. End Sub
  122. Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  123.     a$ = TextTopic(CurrentTopic%).seltext
  124.     If Button = 2 Then
  125.         OldTopic% = CurrentTopic%
  126.         NewTopic% = FindTopic(a$)
  127.         If NewTopic% Then
  128.             HideTopic OldTopic%
  129.             ShowTopic NewTopic%
  130.             End If
  131.     Else
  132.         LinkEdit.Show 1
  133.     End If
  134. MainForm.TextTopic(CurrentTopic%).enabled = -1
  135. StatusBar.caption = "ready"
  136. End Sub
  137. Sub MainFormKeyPressHandler (KeyCode As Integer, Shift As Integer)
  138.     KEY_ESCAPE% = &H1B
  139.     StatusBar.caption = "!!! Cancelled !!!"
  140.     Beep
  141.     If KeyCode = KEY_ESCAPE% Then ' ESC key pressed
  142.         MainForm.TextTopic(CurrentTopic%).enabled = -1
  143.         MainForm.TextTopic(CurrentTopic%).sellength = 0
  144.         StatusBar.caption = "ready"
  145.         End If
  146. End Sub
  147. Sub mBB_Click ()
  148.     temp% = CurrentTopic%
  149.     CurrentTopic% = OldTopic%
  150.     OldTopic% = temp%
  151.     ShowTopic CurrentTopic%
  152.     HideTopic OldTopic%
  153.     MainForm.TextTopic(CurrentTopic%).enabled = -1
  154. End Sub
  155. Sub mBG_Click ()
  156.     GoToTop.Show 1
  157. End Sub
  158. Sub mEC_Click ()
  159.     ni
  160. End Sub
  161. Sub mEL_Click ()
  162.     ni
  163. End Sub
  164. Sub mEP_Click ()
  165.     ni
  166. End Sub
  167. Sub mEPL_Click ()
  168.     ni
  169. End Sub
  170. Sub mFA_Click ()
  171.     ni
  172. End Sub
  173. Sub mFN_Click ()
  174.     ni
  175. End Sub
  176. Sub mFO_Click ()
  177.     ni
  178. End Sub
  179. Sub mFS_Click ()
  180.     DoSave
  181. End Sub
  182. Sub mFX_Click ()
  183. DoQuit
  184. End Sub
  185. Sub Timer1_Timer ()
  186.     Static PrevSel$
  187.     If PrevSel$ = TextTopic(CurrentTopic%).seltext Then Exit Sub
  188.     If Left$(TextTopic(CurrentTopic%).seltext, 1) = "[" Then
  189.         If InStr(Right$(TextTopic(CurrentTopic%).seltext, 2), "]") > 0 Then
  190.             TextTopic(CurrentTopic%).enabled = 0
  191.             StatusBar.caption = "Press Left Button to edit link, Right button to navigate"
  192.         End If
  193.     End If
  194.     PrevSel$ = TextTopic(CurrentTopic%).seltext
  195. End Sub
  196.